app.controller('GlobalController', function ($scope, $rootScope, $http, $interval, $compile, $state) {
    //初始化弹窗插件
    $rootScope.tipPopups = new ShowPopups('.tip-popups');
    $rootScope.tipMessage = '';
    $rootScope.confirmPopups = new ShowPopups('.confirm-popups');
    $rootScope.confirmMessage = '';

    $rootScope.popupsCancel = function () {
        $rootScope.tipPopups.close();
        $rootScope.confirmPopups.close();
    }

    //如果token为空，则跳转到登陆页面
    if(!getToken()){
        setTimeout(function () {
            $state.go(loginPage.stateName);
        }, 400);

    }

});

